]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dateMenu: Allow extensions to add custom calendar sources
authorEskild Hustvedt <code@zerodogg.org>
Wed, 21 Mar 2012 07:59:39 +0000 (08:59 +0100)
committerBastien Nocera <hadess@hadess.net>
Fri, 7 Nov 2014 13:49:38 +0000 (14:49 +0100)
Splits instantiation of the event source into a separate method,
allowing extensions to subclass the DateMenuButton and provide its
own calendar source.

https://bugzilla.gnome.org/show_bug.cgi?id=672500

js/ui/dateMenu.js

index 4bf22b46e9519049e8326dfb4a9baa61c098a00f..c46938a28629d70b1707e718baf4d06118e9ed29 100644 (file)
@@ -173,6 +173,10 @@ const DateMenuButton = new Lang.Class({
         }
     },
 
+    _getEventSource: function() {
+        return new Calendar.DBusEventSource();
+    },
+
     _setEventSource: function(eventSource) {
         if (this._eventSource)
             this._eventSource.destroy();
@@ -190,7 +194,7 @@ const DateMenuButton = new Lang.Class({
         let eventSource;
         let showEvents = Main.sessionMode.showCalendarEvents;
         if (showEvents) {
-            eventSource = new Calendar.DBusEventSource();
+            eventSource = this._getEventSource();
         } else {
             eventSource = new Calendar.EmptyEventSource();
         }